<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
	<script src="js/vue-2.6.12.js"></script>
	<script src="js/vue-router-3.4.9.js"></script>
</head>
<body>


<div id="app">
	<router-link to="register">注册</router-link>
	<router-view></router-view>

</div>

<template id="login-form">
	<div>
		<form>
			用户名:<input type="text" name="username"> <br>
			密码:<input type="password" name="password"> <br>
			<button type="button">登录</button>
		</form>
	</div>
</template>

<template id="register-form">
	<div>
		<form>
		用户名:<input type="text" name="username"> <br>
		密码:<input type="password" name="password"> <br>
		确认密码:<input type="password" name="password2"> <br>
		<button type="button">注册</button> <br>
			<router-link type="button" to="login">登录</router-link>
		</form>
	</div>
	
</template>

<script>
	
	let loginForm = {
	  
	  template:"#login-form",
	  data:{},
	  methods:{}
	  
	}
	let registerForm = {
	  
	  template:"#register-form",
	  date:{},
	  methods: {}
	  
	}
	
	let router = new VueRouter({
	  
	  routes:[
        {name:"default",path:"/",redirect:"/login"},
	    {name:"login",path:"/login",component:loginForm},
	    {name:"register",path: "/register",component: registerForm},
	  ]
	  
	});
	
	let app = new Vue({
	  el:"#app",
	  data:{},
	  methods:{},
	 
	  router:router
	})
	
</script>

</body>
</html>